/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GPIO_H
#define __GPIO_H

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* Exported types ------------------------------------------------------------*/

typedef enum {
	IN_SW1_HYDROPUMP = 0,
	IN_SW2_WATERPUMP,
	IN_SW3_LIGHT,
	IN_SW4_CAMERA,
	IN_GRP3_GREEN,
	IN_GRP2_RED,
	IN_GRP1_YELLOW,
	IN_SW_DRILL_FWD,
	IN_SW_DRILL_RWD,
	IN_SW_CAMERA_REC,
	IN_SW_ROTARY3,
	IN_SW_ROTARY4,
	NO_OF_INPUTS
} GPIOINSignals_enum;

typedef enum {
	OUT_SW1_HYDROPUMP_LED = 0,
	OUT_SW2_WATERPUMP_LED,
	OUT_SW3_LIGHT_LED,
	OUT_SW4_CAMERA_LED,
	OUT_GRP3_GREEN_LED,
	OUT_GRP2_RED_LED,
	OUT_GRP1_YELLOW_LED,
	OUT_POWER_LED,
	NO_OF_OUTPUTS
} GPIOOUTSignals_enum;

typedef struct {
	uint32_t RCC_AHBPeriph;
	GPIO_TypeDef*  GPIO_Port; 
	uint32_t GPIO_Pin;
	uint8_t  pull_drive;
} gpio_struct;

/* Exported functions ------------------------------------------------------- */
void GPIO_Config(void);
void GPIO_Task(void);
uint8_t GPIO_GetInputState(GPIOINSignals_enum in_signal);
void GPIO_SetOutput(GPIOOUTSignals_enum out_signal, uint8_t state);
#endif /* __GPIO_H */
